<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org"  class="app js no-touch no-android chrome no-firefox no-iemobile no-ie no-ie10 no-ie11 no-ios">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>香港魚蝦蟹押寶-查詢</title>
    <meta name="keywords" content="香港魚蝦蟹押寶-查詢 ">
    <meta name="description" content="香港魚蝦蟹押寶-查詢">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link th:href="@{/css/style-chart-min.css}"  type="text/css" rel="stylesheet"  href="../static/css/style-chart-min.css">
    <link th:href="@{/css/bootstrap.min.css}"  rel="stylesheet"  href="../static/css/bootstrap.min.css" type="text/css">
    <link th:href="@{/css/style.css}"  rel="stylesheet"  href="../static/css/style.css" type="text/css">
    <script th:src="@{/js/jquery.min.js}"  src="../static/js/jquery.min.js"></script>
    <script  th:src="@{/js/bootstrap.min.js}" src="../static/js/bootstrap.min.js"></script>

    <link rel="stylesheet" th:href="@{/css/chart-min.css}"  href="../static/css/chart-min.css" type="text/css">
    <script th:src="@{/js/boot-min.js}"  src="../static/js/boot-min.js" type="text/javascript"></script>
    <script th:src="@{/js/ESUNChart-min.js}" src="../static/js/ESUNChart-min.js" type="text/javascript"></script>
    <script th:src="@{/js/jquery.fixedtableheader.min.js}" src="../static/js/jquery.fixedtableheader.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        /*fw.onReady(function(){
         ESUNChart.init();
         oZXZ._on=true;
         oZXZ.check = function(td){
         if(td.className == 'chart-bg-c6 blank-c6' || td.className == 'chart-bg-c10 blank-c10'){
         return true;
         }
         return false;
         }
         oZXZ.bind("fixedtable").color("#fc9613").indent(5).setvl(0).add(13,2,16,0).color("#fc9613").add(29,2,4,0).color("#fc9613").add(33,2,4,0).color("#fc9613").add(37,2,4,0).color("#fc9613").add(41,2,4,0);
         oZXZ.draw(ESUNChart.ini.default_has_line);
         });*/
    </script>

<body style="width: 100%;">
<div class="container container-h bg-white scrollable wrapper wrapper-xxs">
    <!--banner-->
    <form th:action="@{|/index|}" method="post">
    <div class="lot-m clearfix">
        <div class="col-md-4 col-sm-6 lot-latest text-center">
            <div class=" clearfix" style="display:inline-block;">
                <div class="pull-left t-logo">
                    <img src="/img/xianggang_logo.png" tppabs="/img/ruishi_logo.png" style="border-radius: 10px;width: 80px;" >
                    </img>
                </div>
                <div class="lot-section pull-left">
                    <p style="margin-right: 20px;">最新&nbsp;&nbsp;<span id="qishu" style="color:red;" th:text="${data.issueNo}">22136</span>&nbsp;&nbsp;期</p>

                    <div class="lot-section-sel pull-left ng-isolate-scope" style="margin-top:-5px;">

                        <div class="btn-group">
                            <button type="button" class="btn btn-default btn-sm border-radius0" id="prevBtn" onclick="selectQishu(-1)">&lt;</button>
                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-default btn-sm dropdown-toggle border-radius0 ng-binding">
                                    <span id="selectQishu" th:text="${data.issueNo}">22136</span>
                                    <span class="caret h-caret"></span>
                                </button>
                                <ul class="dropdown-menu dropdown-select" id="dropBox"></ul>
                            </div>
                            <button type="button" class="btn btn-default btn-sm border-radius0" disabled="true" id="nextBtn" onclick="selectQishu(1)">&gt;</button></div>
                    </div>
                </div>
                <div class="pull-left t-logo">
                    <img src="/img/huangjia.png" tppabs="/img/ruishi_logo.png" >

                    </img></div>
            </div>

        </div>
        <div class="col-md-4 col-sm-6 open-cutdown no-padder">
            <div class="opentime ng-isolate-scope" id="djs" style="display: inline-block;"><span>下一期:</span><b>01</b><span>分</span><b>35</b><span>秒</span></div>
        </div>
        <div  class="col-md-4 col-sm-6 lot-result">
            <div id="result" class="r1" style="padding: 0px;">
                    <!-- <span class="">上期开奖结果：</span> -->
                    <b>上期開獎結果：</b>
                    <span class="cyanBlue"><img  th:src="${data.firstUrl}"  src="../static/img/yx_1.jpg" width="50px" height="50px"></span>
                    <label class=""> </label>&nbsp;&nbsp;&nbsp;
                    <span class="cyanBlue"><img  th:src="${data.secondUrl}"  src="../static/img/yx_2.jpg" width="50px" height="50px"></span>
                    <label class=""> </label>&nbsp;&nbsp;&nbsp;
                    <span class="cyanBlue"><img th:src="${data.thirdUrl}"  src="../static/img/yx_3.jpg" width="50px" height="50px"></span>
            </div>
            <span class="r3" id="waiting" style="display:none;">正在開獎
                        <img src="/img/icon-status-status-dots-anim-16.gif" tppabs="/img/icon-status-status-dots-anim-16.gif" >
                </img>
            </span></div>
    </div>

    <div class="panel panel-default m-b-none">
        <div class="panel-heading btn-group" style="width:100%;">
            <button style="width:50%" class="btn btn-sm btn-twitter btn-facebook tab-nav" id="tab-result">
                <i class="glyphicon glyphicon-align-justify"></i> 結果
                <span class="arrow bottom h-ab-result"></span></button>
            <button style="width:50%" class="btn btn-sm btn-twitter tab-nav" id="tab-zoushi" >
                <i class="glyphicon glyphicon-stats"></i> 走勢圖
                <span class="arrow bottom h-ab-result" style="display: none;"></span></button>
        </div>
        <div class="table-responsive tab-content" id="content-result">
            <table class="table table-striped b-light" id="records">
                <thead>
                <tr>
                    <th>期號</th>
                    <th>時間</th>
                    <th>號碼</th>
				</tr>
                </thead>
                <tbody>
                    <tr th:each="lottery: ${data.lotterys}">
                        <td th:text="${lottery.issueNo}">22136</td>
                        <td th:text="${lottery.showTime}">12-06 13:41:56</td>
                        <td>
                        <span  class="cyanBlue"><img th:src="${lottery.firstUrl}" src="../static/img/yx_1.jpg" width="20px" height="20px"></span>,
                        <span  class="cyanBlue"><img th:src="${lottery.secondUrl}" src="../static/img/yx_4.jpg" width="20px" height="20px"></span>,
                        <span  class="cyanBlue"><img th:src="${lottery.thirdUrl}" src="../static/img/yx_6.jpg" width="20px" height="20px"></span></td>
                    </tr>
                    <tr  th:remove="all">
                        <td>22135</td>
                        <td>12-06 13:33:26</td>
                        <td>
                        <span class="cyanBlue"><img src="../static/img/yx_1.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_4.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_6.jpg" width="20px" height="20px"></span>
                        </td>
                    </tr>
                    <tr  th:remove="all">
                        <td>22134</td>
                        <td>12-06 13:24:56</td>
                        <td>
                        <span class="cyanBlue"><img src="../static/img/yx_1.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_4.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_6.jpg" width="20px" height="20px"></span>
                        </td>
                    </tr>
                    <tr  th:remove="all">
                        <td>22133</td>
                        <td>12-06 13:16:26</td>
                        <td>
                        <span class="cyanBlue"><img src="../static/img/yx_1.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_4.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_6.jpg" width="20px" height="20px"></span>
                        </td>
                    </tr>
                    <tr  th:remove="all">
                        <td>22132</td>
                        <td>12-06 13:07:56</td>
                        <td>
                        <span class="cyanBlue"><img src="../static/img/yx_1.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_4.jpg" width="20px" height="20px"></span>,
                        <span class="cyanBlue"><img src="../static/img/yx_6.jpg" width="20px" height="20px"></span>
                        </td>
                    </tr>
                </tbody>
            </table>
            
            <div th:include="page-common::pagediv" class="Pagination" style="margin-bottom: 20px;">
                <div>
                    <span class="current">1</span>
                        <a class="num" href="www_njooj_default_2.html">2</a>
                        <a class="num" href="www_njooj_default_3.html">3</a>
                        <a class="num" href="www_njooj_default_4.html">4</a>
                         <a class="num" href="www_njooj_default_5.html">5</a>
                         <a class="next" href="www_njooj_default_6.html">&gt;</a>
                </div>
            </div>


        </div>
        </div>
    </form>
</div>

<script>

    $(function() {
        /**分页处理**/
        $(".pageNumber").click(function(){
            var pageNumber=$(this).attr("pageNumber");
            $(this).closest("form").find("input[name='page']").val(pageNumber);
            $(this).closest("form").submit();
        });

        $("#tab-result").click(function(){
            $(this).closest("form").find("input[name='page']").val(1);
            $(this).closest("form").submit();
        });

        $("#tab-zoushi").click(function(){
            $(this).closest("form").find("input[name='page']").val(1);
            $(this).closest("form").attr("action","/chart");
            $(this).closest("form").submit();
        });

        //倒计时
        //djs(300);
        //最新期数
        initDropList();
    });

    function djs(s) {
        var min = Math.floor(s / 60);
        if (min < 10) {
            min = "0" + min;
        }
        var sec = s % 60;
        if (sec < 10) {
            sec = "0" + sec;
        }
        var timeStr = "<span>下一期:</span><b>" + min + "</b><span>分</span>" + "<b>" + sec + "</b><span>秒</span>";
        $("#djs").html(timeStr);

        if (s == 0) {
            $("#waiting").show();
            $("#result").hide();
            setTimeout(function() { //等待2秒开奖
                    window.location.reload();
                },
                2000);
        } else {
            s--;
            setTimeout(function() {
                    djs(s);
                },
                1000);
        }
    }
    function initDropList() {
        var list = "";
        $.get('/downlist',
                function(res) {
                    var data =res.lotterys;
                    for (var i = 0; i < data.length; i++) {
                        var a = data[i].issueNo;
                        list += '<li><a href="javascript:;" onclick=selectQishu('+a+')>' + a + '</a></li>';
                    }
                    $('#dropBox').html(list);
                    //倒计时开始
                    djs(res.countdown);
                   // djs(300);
                },
                "json");

//        $("#dropBox li a").on("click",
//                function() {
//                    var qishu = $(this).html();
//                    selectQishu(qishu);
//                });
    }


    function selectQishu(qishu) {
        var maxQishu = parseInt($('#qishu').html());
        var minQishu = maxQishu - 9;
        if (qishu == 1 || qishu == -1) {
            var selectQishu = parseInt($('#selectQishu').html());
            qishu = selectQishu + qishu;
        }
        if (qishu == minQishu) {
            $("#prevBtn").attr("disabled", true);
        } else {
            $("#prevBtn").attr("disabled", false);
        }
        if (qishu == maxQishu) {
            $("#nextBtn").attr("disabled", true);
        } else {
            $("#nextBtn").attr("disabled", false);
        }
        if (qishu < minQishu || qishu > maxQishu) {
            return false;
        }
        var url = "/getData";
        $.get(url, {
                number: qishu
            },
            function(res) {
                var html = '<b>上期開獎結果：</b>'+
                '<span class="cyanBlue"><img   src="'+res.firstUrl+'" width="50px" height="50px"></span>'+
                '<label class=""> </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
                        '<span class="cyanBlue"><img  src="'+res.secondUrl+'" width="50px" height="50px"></span>'+
                        '<label class=""> </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
                        '<span class="cyanBlue"><img src="'+res.thirdUrl+'" width="50px" height="50px"></span>';
                $("#result").html(html).show();
                $("#selectQishu").html(res.issueNo);
            },
            "json");
    }</script>


</body></html>